package cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logisModul.dal.mysql.logisticsmodul;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logisModul.controller.admin.logisticsmodul.vo.LogisticsModulExportReqVO;
import cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logisModul.controller.admin.logisticsmodul.vo.LogisticsModulPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.mini.orderInfo.logisModul.dal.dataobject.logisticsmodul.LogisticsModulDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 运费模版 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LogisticsModulMapper extends BaseMapperX<LogisticsModulDO> {

    default PageResult<LogisticsModulDO> selectPage(LogisticsModulPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LogisticsModulDO>()
                .betweenIfPresent(LogisticsModulDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(LogisticsModulDO::getName, reqVO.getName())
                .likeIfPresent(LogisticsModulDO::getLname, reqVO.getLname())
                .eqIfPresent(LogisticsModulDO::getLid, reqVO.getLid())
                .eqIfPresent(LogisticsModulDO::getAddress, reqVO.getAddress())
                .orderByDesc(LogisticsModulDO::getId));
    }

    default List<LogisticsModulDO> selectList(LogisticsModulExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<LogisticsModulDO>()
                .betweenIfPresent(LogisticsModulDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(LogisticsModulDO::getName, reqVO.getName())
                .likeIfPresent(LogisticsModulDO::getLname, reqVO.getLname())
                .eqIfPresent(LogisticsModulDO::getLid, reqVO.getLid())
                .eqIfPresent(LogisticsModulDO::getAddress, reqVO.getAddress())
                .orderByDesc(LogisticsModulDO::getId));
    }

}
